<HTML>
	<TITLE>Workflow.NET
		<%#actionname%>
		-<%#propertyname%></TITLE>
	<STYLE><%#stylesheet%>
	</STYLE>
		<form name="wf_theform" method="post" ID="Form1">
			<TABLE width="100%" height="100%" bgcolor="white" cellspacing="0" cellpadding="0" border="0"
				ID="Table1">
				<TR>
					<TD valign="top">
						<TABLE width="100%" height="100%" ID="Table2">
							<TR>
								<TD valign="top">
									<IFRAME name="frame_preview" src="<%#requeststring%>&amp;pagesection=inputframe&amp;_mode=<%#mode%>&amp;_hidtempstore=<%#hidtempstore%>&amp;_pageinfo=<%#pageinfo%>" width="100%" height="100%">
									</IFRAME>
								</TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="black"><IMG src="?drawimage=spacer.gif" height="1" width="1"></TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="white"><IMG src="?drawimage=spacer.gif" height="1" width="1"></TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="black">
						<IMG src="?drawimage=spacer.gif" height="1" width="1">
					</TD>
				</TR>
				<TR>
					<TD height="1" bgcolor="white">
						<IMG src="?drawimage=spacer.gif" height="1" width="1">
					</TD>
				</TR>
				<TR>
					<TD align="right" height="30">
						<input type="button" class="buttons" value="Back" name="btnback" onclick="history.back()">
						<input type="button" class="buttons" value="Finish" ID="btnFinish" onclick="Finish('<%#mode%>');">
					</TD>
				</TR>
			</TABLE>
			<input type="hidden" name="_hidtempstore" id="_hidtempstore">
			<input type="hidden" name="_mode" ID="_mode">
			<input type="hidden" name="_pageinfo" id="_pageinfo">
		</form>
		<SCRIPT>
			function Finish(mode)
			{


				var SelValue=getselectedvalues();
				if (SelValue == "")
				{
					alert('Incorrect entry. Either value is null/not valid or same variable is used multiple times');
					return ;
				}

				document.wf_theform._mode.value=mode;
				document.wf_theform._pageinfo.value = 'save';
				document.wf_theform._hidtempstore.value=SelValue;
				document.wf_theform.submit()
			}
			function getselectedvalues()
						{
							var returnvalue="";
							var i=0;
							var obj = eval("frame_preview");
							var d = obj.document
							d = eval("d.wf_theform");
							for ( i = 0 ;i<parseInt(d.variablefieldscount.value);i++)
							{

								returnvalue += "#"+ eval("d.VariableFieldName"+i+".value");
								//if(typeof(eval("d.valueinput["+i+"]")) == "undefined")
								var retvalue="";
								if(parseInt(d.variablefieldscount.value) ==1)
								{
									retvalue = eval("d.valueinput.value");

								}
								else
									retvalue = eval("d.valueinput["+i+"].value");

								if(retvalue.indexOf('#') >=0 )
									return "";
								else
									returnvalue += ";"+ retvalue;

							}

							if (returnvalue.length > 0)
								returnvalue = returnvalue.substring(1,returnvalue.length)

							return 	returnvalue;
			}


		</SCRIPT>
	</BODY>
</HTML>
